﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace MvcMovieCollection.Models
{
    public class MoviesViews
    {
        public Movie Movie { get; set; }
        public Genres Genre { get; set; }
    }

    public class AddMovieBase
    {
        public AddMovie AddMovie { get; set; }
        public Genres Genre { get; set; }
    }

    public class EditMovieBase
    {
        public EditMovie EditMovie { get; set; }
        public Genres Genre { get; set; }
    }
    
    public class Movie
    {
        public int ID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }

        [RegularExpression(@"[0-1]?[0-9]/[0-3]?[0-9]/[1-9][0-9][0-9][0-9]",
            ErrorMessage = "Please enter date in mm/dd/yyyy format")]
        public string ReleaseDate { get; set; }
        public string Genre { get; set; }
    }

    public class Genres
    {
        public int ID { get; set; }
        public string Name { get; set; }        
    }

    public class AddMovie
    {
        public string ID { get; set; }

        [Required]
        [StringLength(255, ErrorMessage = "Movie Title cannot exceed 255 characters in length.")] 
        public string Title { get; set; }

        [StringLength(255, ErrorMessage = "Movie Description cannot exceed 255 characters in length.")]
        public string Description { get; set; }

        [RegularExpression(@"[0-1]?[0-9]/[0-3]?[0-9]/[1-9][0-9][0-9][0-9]",
            ErrorMessage = "Please enter date in mm/dd/yyyy format")]
        public string ReleaseDate { get; set; }
        public string Genre { get; set; }
    }

    public class EditMovie
    {
        public int ID { get; set; }

        [Required]
        [StringLength(255, ErrorMessage = "Movie Title cannot exceed 255 characters in length.")]
        public string Title { get; set; }

        [StringLength(255, ErrorMessage = "Movie Description cannot exceed 255 characters in length.")]
        public string Description { get; set; }

        [RegularExpression(@"[0-1]?[0-9]/[0-3]?[0-9]/[1-9][0-9][0-9][0-9]",
            ErrorMessage = "Please enter date in mm/dd/yyyy format")]
        public string ReleaseDate { get; set; }
        public int GenreID { get; set; }
        public string Genre { get; set; }
    }

    public class AddGenre
    {
        [Required]
        [StringLength(255, ErrorMessage = "Movie Genre cannot exceed 255 characters in length.")]
        public string Name { get; set; }
        public string ID { get; set; }
    }

}